﻿<phone:PhoneApplicationPage
    x:Class="Organizer.StartPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
    xmlns:controls="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls"
    mc:Ignorable="d" d:DesignWidth="480" d:DesignHeight="768" 
    xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"
    xmlns:cmd="clr-namespace:GalaSoft.MvvmLight.Command;assembly=GalaSoft.MvvmLight.Extras.WP71"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    SupportedOrientations="PortraitOrLandscape"  Orientation="Portrait"
    shell:SystemTray.IsVisible="True"
    xmlns:toolkit="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit" 
    toolkit:TiltEffect.IsTiltEnabled="True"
    xmlns:my="clr-namespace:Organizer" xmlns:ViewModel="clr-namespace:Organizer.ViewModel">
    <!--d:DataContext="{d:DesignData SampleData/MainViewModelSampleData.xaml}"-->
    <toolkit:TransitionService.NavigationInTransition>
        <toolkit:NavigationInTransition>
            <toolkit:NavigationInTransition.Backward>
                <toolkit:TurnstileTransition Mode="BackwardIn"/>
            </toolkit:NavigationInTransition.Backward>
            <toolkit:NavigationInTransition.Forward>
                <toolkit:TurnstileTransition Mode="ForwardIn"/>
            </toolkit:NavigationInTransition.Forward>
        </toolkit:NavigationInTransition>
    </toolkit:TransitionService.NavigationInTransition>
    <toolkit:TransitionService.NavigationOutTransition>
        <toolkit:NavigationOutTransition>
            <toolkit:NavigationOutTransition.Backward>
                <toolkit:TurnstileTransition Mode="BackwardOut"/>
            </toolkit:NavigationOutTransition.Backward>
            <toolkit:NavigationOutTransition.Forward>
                <toolkit:TurnstileTransition Mode="ForwardOut"/>
            </toolkit:NavigationOutTransition.Forward>
        </toolkit:NavigationOutTransition>
    </toolkit:TransitionService.NavigationOutTransition>
    <!--Data context is set to sample data above and LayoutRoot contains the root grid where all other page content is placed-->

    <phone:PhoneApplicationPage.DataContext>
        <ViewModel:StartPageViewModel />
    </phone:PhoneApplicationPage.DataContext>

    <phone:PhoneApplicationPage.Resources>
       
    </phone:PhoneApplicationPage.Resources>

    <Grid x:Name="LayoutRoot" Background="Transparent">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>

        <!--TitlePanel contains the name of the application and page title-->
        <StackPanel x:Name="TitlePanel" Grid.Row="0" Margin="12,17,0,28">
            <TextBlock x:Name="ApplicationTitle" Text="{Binding Path=LocalizedResources.AppName, Source={StaticResource LocalizedStrings}}" Style="{StaticResource PhoneTextNormalStyle}"/>
            <TextBlock x:Name="PageTitle" Text="{Binding Path=LocalizedResources.StartPage_Title, Source={StaticResource LocalizedStrings}}" Margin="9,-7,0,0" Style="{StaticResource PhoneTextTitle1Style}"/>
        </StackPanel>

        <!--ContentPanel - place additional content here-->
        <Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0">
            <ScrollViewer>
                <Grid>
                    <Grid.RowDefinitions>
                        <RowDefinition Height="Auto"/>
                    </Grid.RowDefinitions>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"/>
                        <ColumnDefinition Width="Auto"/>
                    </Grid.ColumnDefinitions>
                    <my:TiltableGrid  Margin="12,12,5,5" Grid.Row="0" Grid.Column="0" Height="173" Width="173">
                        <toolkit:HubTile x:Name="hub" Background="{StaticResource PhoneAccentBrush}" Height="173" Width="173" HorizontalAlignment="Left"
                                     Title="{Binding Path=LocalizedResources.StartPage_hubHubTitle, Source={StaticResource LocalizedStrings}}" 
                                     Message="{Binding Path=LocalizedResources.StartPage_hubHubMessage, Source={StaticResource LocalizedStrings}}">
                            <!--Source="/Images/men_small.jpg" >-->
                            <toolkit:ContextMenuService.ContextMenu>
                                <toolkit:ContextMenu>
                                    <toolkit:MenuItem Header="{Binding Path=LocalizedResources.MainPage_htPinToStartContext, Source={StaticResource LocalizedStrings}}" x:Name="miPinGroups"/>
                                </toolkit:ContextMenu>
                            </toolkit:ContextMenuService.ContextMenu>
                            <i:Interaction.Triggers>
                                <i:EventTrigger EventName="Tap">
                                    <cmd:EventToCommand Command="{Binding ToHub}" />
                                </i:EventTrigger>
                            </i:Interaction.Triggers>
                        </toolkit:HubTile>
                    </my:TiltableGrid >
                    <my:TiltableGrid  Margin="6,12,6,6" Grid.Row="0" Grid.Column="1" Width="173" Height="173" >
                        <toolkit:HubTile x:Name="hubOrganizations" Background="{StaticResource PhoneAccentBrush}" Height="173" Width="173" HorizontalAlignment="Left" 
                                     Title="{Binding Path=LocalizedResources.StartPage_hubToDoTitle, Source={StaticResource LocalizedStrings}}" 
                                     Message="{Binding Path=LocalizedResources.StartPage_hubTodoMessage, Source={StaticResource LocalizedStrings}}"
                                     toolkit:TiltEffect.IsTiltEnabled="True" >
                            <!--Source="/Images/organizations_small.jpg"-->
                            <toolkit:ContextMenuService.ContextMenu>
                                <toolkit:ContextMenu>
                                    <toolkit:MenuItem Header="{Binding Path=LocalizedResources.MainPage_htPinToStartContext, Source={StaticResource LocalizedStrings}}" x:Name="miPinOrganizations" />
                                </toolkit:ContextMenu>
                            </toolkit:ContextMenuService.ContextMenu>
                            <i:Interaction.Triggers>
                                <i:EventTrigger EventName="Tap">
                                    <cmd:EventToCommand Command="{Binding ToTodo}" />
                                </i:EventTrigger>
                            </i:Interaction.Triggers>
                        </toolkit:HubTile>
                    </my:TiltableGrid >
                </Grid>
            </ScrollViewer>

        </Grid>
    </Grid>
</phone:PhoneApplicationPage>